<?php
// $Id: views-view-field.tpl.php,v 1.1 2008/05/16 22:22:32 merlinofchaos Exp $
 /**
  * This template is used to print a single field in a view. It is not
  * actually used in default Views, as this is registered as a theme
  * function which has better performance. For single overrides, the
  * template is perfectly okay.
  *
  * Variables available:
  * - $view: The view object
  * - $field: The field handler object that can process the input
  * - $row: The raw SQL result that can be used
  * - $output: The processed output that will normally be used.
  *
  * When fetching output from the $row, this construct should be used:
  * $data = $row->{$field->field_alias}
  *
  * The above will guarantee that you'll always get the correct data,
  * regardless of any changes in the aliasing that might happen if
  * the view is modified.
  */
?>
<?php 

//global $user;
//if ($user->uid == 1) print_r($row);

$status = node_mark($row->nid, $row->node_last_comment);
$title = strip_tags(check_markup($row->node_title));
$teaser = str_replace(array("\r\n", "\r"), " ", strip_tags(check_markup($row->node_revisions_teaser)));

$width = ((drupal_strlen($title) > 42) ? 40 : 63);  

$link = truncate_utf8($title . ' <span class="teaser">'. $teaser .'</span>', $width, TRUE).'...';
$link_extended = $title . ': ' . $teaser; 
//print_r($row);
print l($link, 'node/' . $row->nid, 
	array(
		'attributes' => array('class' => (($status <> 0) || (!$user->uid) ? NULL : 'read'), 'title' => $link_extended),
    'fragment' =>  (($status <> 0) && (($row->node_comment_statistics_comment_count - $row->node_new_comments) > 0) ? 'new' : NULL),
		'html' => TRUE
		)
	);


